package ajaxjs.data.entry.common_fields;

import ajaxjs.data.entry.type._String;

public class Intro extends _String{
	public Intro(){
		this.label = "简介";
	}
	
	/**
	 * 如果用户没有输入 intro，则自动读取标题作为 intro；如果以后有输入 intro，则读取 intro
	 * @return
	 */
	public String formatter(){
		String js = "if(!item || typeof item.intro == 'undefined')return;";
		js += "if(!item.intro || item && item.intro == 'null' || item.intro.length < 2)item.intro = item.name;";
		return js;
	}
}
